#include "Random.h"


void InitRand(void)
{
	srand( (unsigned int)time(NULL) );
}

bool RandomBool(void)
{
	// Gives warning C4800, casting int to bool
	return bool( rand() % 2 );
}

int RandomNum(int min, int max)
{
	return rand() % (max - min) + min;
}

float RandomNumf(float min, float max)
{
	return (float)rand() / ( (float)RAND_MAX / (max - min) ) + min;
}

vec3 RandomVec(vec3 min, vec3 max)
{
	return vec3(RandomNum(min.x, max.x),
				RandomNum(min.y, max.y),
				RandomNum(min.z, max.z));
}

vec3 RandomVecf(vec3 min, vec3 max)
{
	return vec3(RandomNumf(min.x, max.x),
				RandomNumf(min.y, max.y),
				RandomNumf(min.z, max.z));
}